package com.ss.android.wenda.answer.detail2;

import android.app.Dialog;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.widget.EditText;
import android.widget.TextView;

import com.bytedance.article.common.c.TTUtils;
import com.bytedance.common.utility.Logger;

final class m implements TextView.OnEditorActionListener {
    private final NewAnswerDetailActivity c;
    private final EditText a;
    private final Dialog b;

    m(NewAnswerDetailActivity arg1, EditText arg2, Dialog arg3) {
        this.c = arg1;
        this.a = arg2;
        this.b = arg3;
    }

    public final boolean onEditorAction(TextView arg6, int arg7, KeyEvent arg8) {
        String v4 = null;
        if ((this.c.isViewValid()) && (6 == arg7 || arg7 == 0)) {
            Logger.d(NewAnswerDetailActivity.a, "action id is " + arg7);
            String v0 = this.a.getText().toString();
            if (!TextUtils.isEmpty(((CharSequence) v0))) {
                if (TTUtils.isValidUrl(v0)) {
                    android.support.design.a.b(this.c, v0, v4);
                } else {
                    android.support.design.a.b(this.c, "http://" + v0, v4);
                }
            }

            this.b.dismiss();
        }

        return true;
    }
}

